package com.AX.service.impl;

import com.AX.entity.User;
import com.AX.exception.NoPathException;
import com.AX.mapper.LoginMapper;
import com.AX.mapper.ParkingLotMapper;
import com.AX.service.UserDetailsService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class UserDetailsServiceImpl implements UserDetailsService {

    private final LoginMapper loginMapper;
    public User yz(String username, String passward) throws NoPathException
    {
        return loginMapper.findUser(username,passward);
    }

    @Override
    public User register(User user) throws NoPathException {

            // 保存用户
            loginMapper.insert(user);
            return user;
    }
}

